import { defHttp } from '/@/utils/http/axios';
import {  WebsiteExamEnrollModel, WebsiteExamEnrollTableRecordModel } from '../model/websiteExamEnrollModel';
import { ErrorMessageMode } from "/#/axios";

enum Api {
  WEBSITEEXAMENROLL_PAGE = '/jxxhWebsite/websiteExamEnroll/getExamEnrollVosPage',
  GET_WEBSITEEXAMENROLLVO_BY_ID = '/jxxhWebsite/websiteExamEnroll/',
  WEBSITEEXAMENROLLVO_SAVE = '/jxxhWebsite/websiteExamEnroll/save',
  WEBSITEEXAMENROLLVO_UPDATE = '/jxxhWebsite/websiteExamEnroll/updateById',
  WEBSITEEXAMENROLLVO_REMOVE = '/jxxhWebsite/websiteExamEnroll/logicalRemoveById/',
}

/**
 * @description: Get sample list value
 */

export const websiteExamEnrollListApi = (params: Object) =>
  defHttp.get<WebsiteExamEnrollTableRecordModel>(
    {url: Api.WEBSITEEXAMENROLL_PAGE,params },
    { errorMessageMode: 'message' }
  );

export const getWebsiteExamEnrollVoByIdApi = (id) =>
  defHttp.get<WebsiteExamEnrollModel>(
    {url: Api.GET_WEBSITEEXAMENROLLVO_BY_ID+id },
    { errorMessageMode: 'message' }
  );

export function websiteExamEnrollSaveApi(params: WebsiteExamEnrollModel, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<WebsiteExamEnrollModel>(
    {
      url: Api.WEBSITEEXAMENROLLVO_SAVE,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export function websiteExamEnrollUpdateApi(params: WebsiteExamEnrollModel, mode: ErrorMessageMode = 'modal') {
  return defHttp.put<WebsiteExamEnrollModel>(
    {
      url: Api.WEBSITEEXAMENROLLVO_UPDATE,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export const logicalRemoveById = (id) =>
  defHttp.delete<WebsiteExamEnrollModel>(
    {url: Api.WEBSITEEXAMENROLLVO_REMOVE+id },
    { errorMessageMode: 'message' }
  );
